//package cur.component.redis.guava;
//
//import com.google.common.cache.CacheBuilder;
//import com.google.common.cache.CacheLoader;
//import com.google.common.cache.LoadingCache;
//import lombok.Getter;
//import lombok.Setter;
//
//import java.util.List;
//
//@Getter
//@Setter
//public abstract class DefaultGuavaCache {
//    public LoadingCache<String, Object> cache;
//
//    public DefaultGuavaCache(final int maxNum) throws Exception {
//        this.cache = CacheBuilder.newBuilder().maximumSize(maxNum).build(this.load());
//    }
//    public abstract CacheLoader load() throws Exception;
//
////    @Data
////    @AllArgsConstructor
////    public static class Dict {
////        private String type;//字典类型
////        private String key;//字典键
////        private String value;//字典值
////    }
//
//
//
//    public static void main(String[] args) throws Exception {
//
//
//        LoadingCache<String,String> cache = CacheBuilder.newBuilder()
//                .build(new CacheLoader<String, String>() {
//                    @Override
//                    public String load(String key) throws Exception {
//                        System.out.println(key + " is loaded from a cacheLoader!");
//                        return key + "'s value";
//                    }
//                });
//        cache.put("key1","value1");
//        cache.put("key2","value2");
//        cache.put("key3","value3");
//        System.out.println("第一个值：" + cache.getIfPresent("key1"));
//        System.out.println("第二个值：" + cache.getIfPresent("key2"));
//        System.out.println("第三个值：" + cache.getIfPresent("key3"));
//        System.out.println("第三个值：" + cache.get("key4"));
//    }
//}
